<?php
/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/12/27 11:07
 * Desc: 会员卡限购数量
 */
class Service_Ferry_Ticket_StockLimit_Order extends Contract_Ticket_StockLimit_Stock
{
    public function handle($ticket_info, $stock, $use_date, $params = array())
    {
        if($ticket_info['is_open_limit_order_num'] == 1 && $ticket_info['limit_order_num'] > 0) {
            $stock = min($stock, $ticket_info['limit_order_num']);
        }

        return $stock;
    }
}